# 定义一个学生类,有下面的类属性:
# 1.姓名 2.年龄 3.成绩（语文,数学,英语）(成绩为整数)
# 类方法
# 1.获取学生的姓名get_name()返回类型str
# 2.获取学生的年龄get_age()返回类型int
# 3.返回3门课中分数最高的课get_course()
# 4.返回学生的平均成绩get_avg()
# class student(object):
#     def __init__(self, name, age, english, math, chinese ):
#         self.name = name
#         self.age = age
#         self.english = english
#         self.math = math
#         self.chinese = chinese
#
#     def get_name(self):
#         print(self.name)
#
#     def get_age(self):
#         print(self.age)
#
#     def get_course(self):
#         max = 0
#         if self.english > self.math > self.chinese:
#             max = self.english
#             print(max)
#         elif self.math > self.chinese > self.english:
#             max = self.math
#             print(max)
#         else:
#             max = self.chinese
#             print(max)
#
#     def get_avg(self):
#         print((self.chinese + self.english + self.math)/3)
#
# student = student("小明", 18 , 71 , 70, 80)
# student.get_name()
# student.get_age()
# student.get_avg()
# student.get_course()

# 查看当前的操作系统和python的版本号
# import sys
# print(sys.platform)
# print(sys.version)

# 遍历出D盘下所有文件和文件夹
import os

path = "D://"
def get_files(path):
    list = os.listdir(path)
    for i in list:
        if i == "$RECYCLE.BIN" or i == "Config.Msi" or i == "System Volume Information":
            continue
        print(i)
        path_files = os.path.join(path, i)
        if os.path.isdir(path_files):
            get_files(path_files)

get_files(path)

# 以2018-9-22 14:3:11 格式输出当前时间
# import time
# print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))

# 实现对班级学生的随机姓名
# import random
# students_list = ["小米", "小明", "小花", "小艾"]
# print(students_list[random.randint(0, len(students_list)-1)])